package com.hnichr.ump.api.controller;

import com.hnichr.ump.common.onetime.invite.service.AnnualInviteService;
import com.hnichr.ump.common.onetime.invite.vo.SignVo;
import com.mxpioframework.common.vo.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "AnnualInviteController", description = "年会邀请")
@RestController
@RequestMapping("/api/annual/invite")
public class AnnualInviteController {
    @Autowired
    private AnnualInviteService annualInviteService;

    @GetMapping("signature")
    public Result<SignVo> signature(@RequestParam String url){
        SignVo signVo = annualInviteService.sign(url);
        if(signVo==null){
            return Result.error("系统异常");
        }
        return Result.OK(signVo);
    }
}
